package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_payment_shop")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PosTransactionPaymentShop.findAll", query = "SELECT p FROM PosTransactionPaymentShop p"),
    @NamedQuery(name = "PosTransactionPaymentShop.findBySync", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.sync = :sync"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopId", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopId = :paymentShopId"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopDate", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopDate = :paymentShopDate"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopTotal", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopTotal = :paymentShopTotal"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopPaid", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopPaid = :paymentShopPaid"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopKeel", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopKeel = :paymentShopKeel"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopPay", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopPay = :paymentShopPay"),
    @NamedQuery(name = "PosTransactionPaymentShop.findByPaymentShopTimestamp", query = "SELECT p FROM PosTransactionPaymentShop p WHERE p.paymentShopTimestamp = :paymentShopTimestamp")})
public class PosTransactionPaymentShop implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private Integer sync;
    @Id
    @Basic(optional = false)
    @Column(name = "payment_shop_id")
    private Integer paymentShopId;
    @Column(name = "payment_shop_date")
    @Temporal(TemporalType.DATE)
    private Date paymentShopDate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "payment_shop_total")
    private BigDecimal paymentShopTotal;
    @Column(name = "payment_shop_paid")
    private BigDecimal paymentShopPaid;
    @Column(name = "payment_shop_keel")
    private String paymentShopKeel;
    @Column(name = "payment_shop_pay")
    private BigDecimal paymentShopPay;
    @Column(name = "payment_shop_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date paymentShopTimestamp;
    @Lob
    @Column(name = "payment_shop_description")
    private String paymentShopDescription;
    @JoinColumn(name = "payment_shop_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser paymentShopUserId;
    @JoinColumn(name = "payment_shop_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit paymentShopUnitId;
    @JoinColumn(name = "payment_shop_distribution_id", referencedColumnName = "distribution_id")
    @ManyToOne
    private PosTransactionDistribution paymentShopDistributionId;

    public PosTransactionPaymentShop() {
    }

    public PosTransactionPaymentShop(Integer paymentShopId) {
        this.paymentShopId = paymentShopId;
    }

    public Integer getSync() {
        return sync;
    }

    public void setSync(Integer sync) {
        this.sync = sync;
    }

    public Integer getPaymentShopId() {
        return paymentShopId;
    }

    public void setPaymentShopId(Integer paymentShopId) {
        this.paymentShopId = paymentShopId;
    }

    public Date getPaymentShopDate() {
        return paymentShopDate;
    }

    public MasterUser getPaymentShopUserId() {
        return paymentShopUserId;
    }

    public void setPaymentShopUserId(MasterUser paymentShopUserId) {
        this.paymentShopUserId = paymentShopUserId;
    }

    public MasterUnit getPaymentShopUnitId() {
        return paymentShopUnitId;
    }

    public void setPaymentShopUnitId(MasterUnit paymentShopUnitId) {
        this.paymentShopUnitId = paymentShopUnitId;
    }

    public PosTransactionDistribution getPaymentShopDistributionId() {
        return paymentShopDistributionId;
    }

    public void setPaymentShopDistributionId(PosTransactionDistribution paymentShopDistributionId) {
        this.paymentShopDistributionId = paymentShopDistributionId;
    }

    public void setPaymentShopDate(Date paymentShopDate) {
        this.paymentShopDate = paymentShopDate;
    }

    public BigDecimal getPaymentShopTotal() {
        return paymentShopTotal;
    }

    public void setPaymentShopTotal(BigDecimal paymentShopTotal) {
        this.paymentShopTotal = paymentShopTotal;
    }

    public BigDecimal getPaymentShopPaid() {
        return paymentShopPaid;
    }

    public void setPaymentShopPaid(BigDecimal paymentShopPaid) {
        this.paymentShopPaid = paymentShopPaid;
    }

    public String getPaymentShopKeel() {
        return paymentShopKeel;
    }

    public void setPaymentShopKeel(String paymentShopKeel) {
        this.paymentShopKeel = paymentShopKeel;
    }

    public BigDecimal getPaymentShopPay() {
        return paymentShopPay;
    }

    public void setPaymentShopPay(BigDecimal paymentShopPay) {
        this.paymentShopPay = paymentShopPay;
    }

    public Date getPaymentShopTimestamp() {
        return paymentShopTimestamp;
    }

    public void setPaymentShopTimestamp(Date paymentShopTimestamp) {
        this.paymentShopTimestamp = paymentShopTimestamp;
    }

    public String getPaymentShopDescription() {
        return paymentShopDescription;
    }

    public void setPaymentShopDescription(String paymentShopDescription) {
        this.paymentShopDescription = paymentShopDescription;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paymentShopId != null ? paymentShopId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionPaymentShop)) {
            return false;
        }
        PosTransactionPaymentShop other = (PosTransactionPaymentShop) object;
        if ((this.paymentShopId == null && other.paymentShopId != null) || (this.paymentShopId != null && !this.paymentShopId.equals(other.paymentShopId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionPaymentShop[ paymentShopId=" + paymentShopId + " ]";
    }
}
